<template>
  <div>
    <el-container>
      <!-- 则边栏导航 -->
      <el-aside width="200px">
        <div class="box">管理系统</div>
        <div>
          <el-menu default-active="1">
            <el-menu-item index="1" @click="ck2('shou')">
              <i class="el-icon-menu"></i>
              <span slot="title">首页</span>
            </el-menu-item>
            <el-menu-item index="2" @click="ck1('shop')">
              <i class="el-icon-document"></i>
              <span slot="title">商品管理</span>
            </el-menu-item>

            <el-menu-item index="3" @click="ck('user')">
              <i class="el-icon-setting"></i>
              <span slot="title">用户管理</span>
            </el-menu-item>

            <el-submenu index="4">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>其他</span>
              </template>
              <el-menu-item-group>
                <el-menu-item @click="ck4('miana')" index="4-1"
                  >页面1</el-menu-item
                >
                <el-menu-item @click="ck5('mianb')" index="4-2"
                  >页面2</el-menu-item
                >
              </el-menu-item-group>
            </el-submenu>
          </el-menu>
        </div>
      </el-aside>
      <el-container>
        <!-- 头部导航栏 -->
        <el-header>
          <div>
            <el-breadcrumb>
              <el-breadcrumb-item class="imgbox">
                <i class="el-icon-menu"></i>
              </el-breadcrumb-item>
              <el-breadcrumb-item :to="{ path: '/shou' }"
                >首页</el-breadcrumb-item
              >
              <el-breadcrumb-item :to="{ path: '/huo' }"
                >活动管理</el-breadcrumb-item
              >
              <el-breadcrumb-item :to="{ path: '/jie' }"
                >活动列表</el-breadcrumb-item
              >
            </el-breadcrumb>
          </div>
        </el-header>
        <el-main>
          <div>
            <router-view></router-view>
          </div>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  methods: {
    ck(user1) {
      this.$router.push({ name: user1 }); //跳转到用户页面
    },
    ck1(shop1) {
      this.$router.push({ name: shop1 }); //跳转到商品页面
    },
    ck2(shou1) {
      this.$router.push({ name: shou1 }); //跳转到首页
    },
    ck4(miana1) {
      this.$router.push({ name: miana1 });
    },
    ck5(mianb1) {
      this.$router.push({ name: mianb1 });
    },
  },
};
</script>

<style lang="less" scoped>
.el-header {
  background-color: #a7eba0ce;
  color: #333;
  text-align: center;
  line-height: 60px;
}
.el-menu-item {
  background-color: #a2e5f2ae;
}
.el-submenu {
  background-color: #a2e5f2ae;
}
.el-aside {
  // position: absolute;
  background-color: #6f9aa382;
  color: #333;
  text-align: center;
  height: 680px;
  font-size: 30px;
}
//面包屑组件
.el-breadcrumb {
  line-height: 60px;
  height: 60px;
  font-size: 20px;
}
.box {
  background-color: #6f9aa35b;
  // height: 60px;
  line-height: 60px;
}
.el-main {
  position: relative;
  background-color: #e9eef3;
  color: #333;
  height: 620px;
  // text-align: center;
  // line-height: 160px;
}

body > .el-container {
  margin-bottom: 40px;
}
.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
.el-menu-item-group {
  background-color: #6f9aa382;
}
</style>